package cn.tedu._03vehicle.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class UserRegParam {
   // @NotNull(message = "用户名不能为空")
   // @NotEmpty(message = "用户名不能为空字符串和null")
   //@NotBlank(message = "用户名不能为空字符串和null和空字符串")
   // @Size(min = 2,max = 10,message = "用户名长度必须在2-10之间")
 @Pattern(regexp = "^(?:[a-zA-Z]{1,14}|[\\u4e00-\\u9fa5]{1,7})$",message = "用户名不超过7个汉字或14个英文")
    @Schema(description = "用户名",required=true)
    private String username;
 @Pattern(regexp = "^(?!.*[\\u4e00-\\u9fa5\\s])(?=.*[a-zA-Z])(?=.*[\\d\\p{Punct}])[\\w\\p{Punct}]{8,14}$|^(?!.*[\\u4e00-\\u9fa5\\s])(?=.*\\d)(?=.*[a-zA-Z\\p{Punct}])[\\w\\p{Punct}]{8,14}$",message = "密码长度必须在8-14之间，且包含数字、英文、特殊字符，不能包含汉字和空格")
    @Schema(description = "密码",required=true)
    private String password;
    @Schema(description = "邮箱",required=true)
    private String email;
    @Pattern(regexp="^1\\d{2}-\\d{4}-\\d{3}$")
    @Schema(description = "手机号码",required=true )
    private String phone;
}

